<?php
namespace app\apiCompany\Validate;

use think\Validate;

/**
 * 用户验证类
 */
class UserValidate extends Validate
{
    protected $rule = [
        'code' => 'require',
        'openid' => 'require',
        'name' => 'require',
        'username' => 'require',
        'mobile' => 'require',
        'companyimages' => 'require',
        'posterimages' => 'require',
        'identityimage' => 'require',
        'establishDate' => 'require',
        'money' => 'require',
        'address' => 'require',
        'business_address' => 'require',
        'person_num' => 'require',

    ];
    protected $message = [

        'openid.require'  => 'openid不能为空',
        'name.require'  => '企业名称不能为空',
        'username.require'  => '用户名称不能为空',
        'mobile.require'  => '手机号码不能为空',
        'companyimages.require'  => '公司相册不能为空',
        'posterimages.require'  => '公司海报不能为空',
        'identityimage.require'  => '营业执照图片不能为空',
        'establishDate.require'  => '成立时间不能为空',
        'money.require'  => '注册金额不能为空',
        'code.require'  => '统一社会信用代码不能为空',
        'address.require'  => '注册地址',
        'business_address.require'  => '经营地址',
        'person_num.require'  => '人员规模',
    ];
    protected $scene = [
        'mobil_register' => [
            'name',
            'username',
            'mobile',
            // 'companyimages',
            // 'posterimages',
            // 'identityimage',
            'establishDate',
            'money',
            // 'code',
            'address',
            'business_address',
            'person_num',
            ],
        'registers' => [
            // 'wx_code',
            'name',
            'username',
            'mobile',
            'companyimages',
            'posterimages',
            'identityimage',
            'establishDate',
            'money',
            // 'code',
            'address',
            'business_address',
            'person_num',
        ]
    ];
}